import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (data) => {
    return request({
        url: 'role/getRoleList',
        method: 'post',
        data
    });
}

// 新增角色
export const addRole = (data) => {
    return request({
        url: 'role/addRole',
        method: 'post',
        data
    });
}

// 编辑角色
export const editRole = (data) => {
    return request({
        url: 'role/editRole',
        method: 'post',
        data
    });
}

// 获取角色菜单
export const getRoleMenu = (data) => {
    return request({
        url: 'role/getRoleMenu',
        method: 'post',
        data
    });
}

// 删除角色
export const delRole = (data) => {
    return request({
        url: 'role/delRole',
        method: 'post',
        data
    });
}

// 更新角色权限
export const updateRoleMenu = (data) => {
    return request({
        url: 'role/updateRoleMenu',
        method: 'post',
        data
    });
}

// 根据菜单获取角色按钮权限
export const getRoleButtons = (data) => {
    return request({
        url: 'role/getRoleButtons',
        method: 'post',
        data
    });
}

// 修改角色按钮权限
export const updateRoleButton = (data) => {
    return request({
        url: 'role/updateRoleButton',
        method: 'post',
        data
    });
}
